package com.example.test2;

public class Demo2 {
    public static void main(String[] args) {
        
        show(new UserService() {
            @Override
            public void show() {
                System.out.println("Show方法执行1");
            }
        });

        show(() -> System.out.println("Show方法执行2"));
    }
    public static void show(UserService userService) {
        userService.show();
    }
}
